package day11;

public class DurationTest { 
    public static void main(String[] args) { 

        //三参构造器实例化对象 
        Duration d1 = new Duration(1,1,1); 

        //获取总秒数 
        int totalSeconds = d1.getTotalSeconds(); 
        System.out.println("1小时1分钟1秒：" + totalSeconds); 
        System.out.println("------------------"); 

        //单参构造器实例化对象 
        Duration d2 = new Duration(3660); 

        //获取小时 
        int hour = d2.getHour(); 
        System.out.println("hour = " + hour); 
        System.out.println("------------------"); 
        
        //输出对象属性信息及总描述信息 
        d2.display(); 
    } 
}